import React, { Component } from 'react';
import {NavBar,Icon} from 'antd-mobile';
import './qrscan.css'

class Qrscan extends Component {

    componentDidMount() {
        this.startScan()
    }

    startScan = () => {
        if (typeof plus !== "undefined") { 
            console.log('不支持二维码扫描')
            // console.log(plus)
            return
        }
        // 扫描二维码
        // const barScan = new plus.barcode.Barcode("scanContainer");
        // barScan.onmarked = (type,code,file)=>{
        //     const result = "type"+type+"<br/>code:"+code+"<br/>file:"+file;
        //     console.log(result)
        //     this.props.onResult(code)
        // };
    }

    render() {
        return (
            <div>
                <NavBar
                icon={<Icon type="left" />}
                onLeftClick={() => this.props.history.goBack()}
                >扫描核销码</NavBar>
                <div className="scanWindow" />
            </div>
        )
    }
}

export default Qrscan